Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
*/
-#include <stdio.h>
#include "defs.h"
+#include "filterdefs.h"
#include "grtcirc.h"
#define MYNAME "Arc filter"
-extern queue waypt_head;
-
static double pos_dist;
static char *distopt = NULL;
static char *arcfileopt = NULL;
} style_vecs_t;
extern style_vecs_t style_list[];
-typedef struct filter_vecs {
- filter_init f_init;
- filter_process f_process;
- filter_deinit f_deinit;
- filter_exit f_exit;
- arglist_t *args;
-} filter_vecs_t;
-
void waypt_init(void);
void route_init(void);
void waypt_disp(const waypoint *);
void disp_formats(int version);
void printposn(const double c, int is_lat);
-filter_vecs_t * find_filter_vec(char * const, char **);
-void free_filter_vec(filter_vecs_t *);
-void disp_filters(int version);
-void disp_filter_vecs(void);
-void exit_filter_vecs(void);
-
#ifndef DEBUG_MEM
void *xcalloc(size_t nmemb, size_t size);
void *xmalloc(size_t size);
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
*/
-#include <stdio.h>
+
#include "defs.h"
+#include "filterdefs.h"
static char *hdopopt = NULL;
static char *vdopopt = NULL;
*/
#include <stdio.h>
#include "defs.h"
-
-extern queue waypt_head;
+#include "filterdefs.h"
static char *snopt = NULL;
static char *lcopt = NULL;
}
-void
+
+static void
duplicate_process(void)
{
waypoint * waypointp;
int i, ct = waypt_count();
wpt_ptr *htable, *bh;
queue *elem, *tmp;
- extern queue waypt_head;
htable = (wpt_ptr *) xmalloc(ct * sizeof(*htable));
bh = htable;
}
}
-void
-duplicate_init(const char *args)
-{
-}
-
-void
-duplicate_deinit(void)
-{
-}
-
filter_vecs_t duplicate_vecs = {
- duplicate_init,
+ NULL,
duplicate_process,
- duplicate_deinit,
+ NULL,
NULL,
dup_args
};
*******************************************************************************/
static void
-filter_skeleton_init(const char *args) /* optional */
+filter_skeleton_init(const char *args) /* optional. If not needed, delete and replace entry in vecs with NULL */
{
}
}
static void
-filter_skeleton_deinit(void) /* optional */
+filter_skeleton_deinit(void) /* optional. If not needed, delete and replace entry in vecs with NULL*/
{
}
*/
-#include <stdio.h>
#include "defs.h"
+#include "filterdefs.h"
typedef struct {
filter_vecs_t *vec;
--- /dev/null
+/*
+ Filter definitions.
+
+ Copyright (C) 2005 Robert Lipe, robertlipe@usa.net
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
+
+ */
+
+
+
+/*
+ * Filters can do some things that modules really shouldn't do.
+ * This is our (weak) attempt to make that distinction.
+ */
+
+extern queue waypt_head;
+
+typedef struct filter_vecs {
+ filter_init f_init;
+ filter_process f_process;
+ filter_deinit f_deinit;
+ filter_exit f_exit;
+ arglist_t *args;
+} filter_vecs_t;
+
+filter_vecs_t * find_filter_vec(char * const, char **);
+void free_filter_vec(filter_vecs_t *);
+void disp_filters(int version);
+void disp_filter_vecs(void);
+void exit_filter_vecs(void);
+
#include "defs.h"
+#include "filterdefs.h"
#include "cet.h"
#include "cet_util.h"
#include <ctype.h>
*/
#include "defs.h"
+#include "filterdefs.h"
#define MYNAME "Polygon filter"
-extern queue waypt_head;
-
static char *polyfileopt = NULL;
static char *exclopt = NULL;
*/
#include "defs.h"
+#include "filterdefs.h"
#include "grtcirc.h"
#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
-extern queue waypt_head;
static route_head *cur_rte = NULL;
static double pos_dist;
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
*/
-#include <stdio.h>
#include "defs.h"
+#include "filterdefs.h"
#define MYNAME "Route reversal filter"
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
*/
-#include <stdio.h>
#include "defs.h"
+#include "filterdefs.h"
#include "grtcirc.h"
#define MYNAME "Route simplification filter"
*/
#include "defs.h"
-
-extern queue waypt_head;
+#include "filterdefs.h"
typedef enum {
sm_unknown = 0,
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
*/
-#include <stdio.h>
+
#include "defs.h"
+#include "filterdefs.h"
#define MYNAME "Stack filter"
-extern queue waypt_head;
-
static char *opt_push = NULL;
static char *opt_copy = NULL;
static char *opt_pop = NULL;
2005-07-29: warning fixes
*/
-#include <stdio.h>
-#include <time.h>
#include <ctype.h>
#include "defs.h"
+#include "filterdefs.h"
#include "strptime.h"
#define MYNAME "trackfilter"
static int track_pts = 0;
static int opt_interval = 0;
-/*******************************************************************************
-* dummy callbacks for track_disp_all
-*******************************************************************************/
-
-static void
-trackfilter_noop_w(const waypoint *w)
-{
-}
-
-static void
-trackfilter_noop_t(const route_head *h)
-{
-}
-
/*******************************************************************************
* helpers
*******************************************************************************/
/* check all tracks for time and order (except merging) */
- track_disp_all(trackfilter_fill_track_list_cb, trackfilter_noop_t, trackfilter_noop_w);
+ track_disp_all(trackfilter_fill_track_list_cb, NULL, NULL);
qsort(track_list, track_ct, sizeof(*track_list), trackfilter_init_qsort_cb);
}
}